#ifndef _CONFSVR_HPP_20120614
#define _CONFSVR_HPP_20120614

#include <ext/hash_map>

#include "singleton.hpp"
#include "connection.hpp"
#include "acceptor_manager.hpp"
#include "basesvr.hpp"

#include "processor.hpp"
#include "cmd_parser.hpp"

using namespace mina;
using namespace cmd;

class ConfSvr : public BaseSvr, public Singleton<ConfSvr>
{
	public :
		friend class Singleton<ConfSvr>;

	public :
		typedef AcceptorManager Reactor;

	public :
		virtual ~ConfSvr() { finish(); }

		template <typename _Msg>
			int handle(Connection & conn, _Msg & msg)
			{   
				assert(false);
			}   

		// should implement those function
		virtual int impl_init(); 
		virtual int process();
		virtual int reload();
		virtual int finish();

		Reactor * reactor()               { return _reactor; }

	public :
		Reactor         *  _reactor;

		CmdParser          _parser;
		Processor<ConfSvr> _processor;
};

#endif

